<template>
	<view>
		<navtop :title="title"></navtop>
		<view v-if="text!=''" class="text">
			<rich-text :nodes="text"></rich-text>
		</view>
		<loading :load="true" v-else></loading>
	</view>
</template>

<script>
    let that = null;
    export default {
        data() {
            return {
				type: 'agreement',
				text: '',
				title: '用户协议',
				isapp: false
            }
        },
        onLoad(e) {
            that = this;
			if(e.type) that.type = e.type;
			that.get_data();
			if(that.type == 'privacy'){
				that.title = '隐私政策';
				uni.setNavigationBarTitle({
				    title: '隐私政策'
				});
			}
			// #ifdef APP-PLUS
			that.isapp = true;
			// #endif
        },
        methods: {
			get_data(){
				that.http.get_curl('init/help',{type:that.type},function(res){
					if(res.code == 1){
						that.text = res.data.text;
					}
				});
			}
        }
    }
</script>

<style lang="scss" scoped>
    .text{padding: 16px;
        h3{font-size: 16px;color: #333;font-weight: bold;padding: 10px 0;}
        p{font-size: 14px;color: #333;text-indent: 2em;line-height: 25px;}
    }
</style>